import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait


def ceshiren_driver():
    driver = webdriver.Chrome()
    driver.get('https://ceshiren.com/')
    driver.implicitly_wait(10)
    driver.find_element(By.CSS_SELECTOR, '#search-button > svg').click()
    driver.find_element(By.ID, 'search-term').send_keys('ChromeDriver')
    res_search = (By.CSS_SELECTOR, '.widget-link.show-advanced-search')
    WebDriverWait(driver, 10).until(expected_conditions.element_to_be_clickable((res_search)))
    driver.find_element(*res_search).click()
    time.sleep(3)
    driver.find_element(By.CSS_SELECTOR, '.btn-primary.search-cta').click()
    time.sleep(3)



if __name__ == '__main__':
    ceshiren_driver()